package com.nxk.modules.core.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nxk.modules.core.dao.SysOfficeDao;
import com.nxk.modules.core.entity.BaseEntity;
import com.nxk.modules.core.entity.SysOffice;
import com.nxk.modules.core.service.SysOfficeService;
import org.springframework.stereotype.Service;
import org.apache.commons.lang3.StringUtils;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.UUID;

@Service
public class SysOfficeServiceImpl extends ServiceImpl<SysOfficeDao, SysOffice> implements SysOfficeService {


    @Override
    @Transactional(readOnly = false)
    public boolean save(SysOffice sysOffice) {
        SysOffice byId = super.getById(sysOffice.getId());
        if (StringUtils.isNotBlank(sysOffice.getId()) && byId != null) {
            return super.updateById(sysOffice);
        } else {
            return super.save(sysOffice);
        }
    }


}
